package PropertiesDemo;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class PropertiesDemo {

	public static void main(String[] args) {
		
		Properties prop = new Properties();
		
		FileReader fr = null;
		try {
			fr = new FileReader("prop.properties");
			prop.load(fr);
			String name = prop.getProperty("name");
			String age = prop.getProperty("age");
			String gender = prop.getProperty("gender");
			System.out.println(name);
			System.out.println(age);
			System.out.println(gender);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if(fr != null)
					fr.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		
	}
}
